<?php

class Application_Plugin_Yandexmap_Plugin extends Nimblecms_Controller_Plugin {
	
	public function __construct() {
		parent::__construct();
	}
	
	public function preDispatch(Zend_Controller_Request_Abstract $request) {
		
		$apikey = $this->getParam('apikey');
		
		$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
		if (null === $viewRenderer->view) {
			$viewRenderer->initView();
		}
		$view = $viewRenderer->view;
		
		$view->headScript()->appendFile('http://api-maps.yandex.ru/1.1/index.xml?key=' . $apikey);
	}
}

?>